3.32 \(\int \cot ^2(c+d x) (a+a \sec (c+d x))^2 \, dx\)

Optimal. Leaf size=35 \[ -\frac{2 a^2 \cot (c+d x)}{d}-\frac{2 a^2 \csc (c+d x)}{d}+a^2 (-x) \]

[Out]

-(a^2*x) - (2*a^2*Cot[c + d*x])/d - (2*a^2*Csc[c + d*x])/d

________________________________________________________________________________________

Rubi [A]  time = 0.0721307, antiderivative size = 35, normalized size of antiderivative = 1., number of steps used = 8, number of rules used = 5, integrand size = 21, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.238, Rules used = {3886, 3473, 8, 2606, 3767} \[ -\frac{2 a^2 \cot (c+d x)}{d}-\frac{2 a^2 \csc (c+d x)}{d}+a^2 (-x) \]

Antiderivative was successfully verified.

[In]

Int[Cot[c + d*x]^2*(a + a*Sec[c + d*x])^2,x]

[Out]

-(a^2*x) - (2*a^2*Cot[c + d*x])/d - (2*a^2*Csc[c + d*x])/d

Rule 3886

Int[(cot[(c_.) + (d_.)*(x_)]*(e_.))^(m_)*(csc[(c_.) + (d_.)*(x_)]*(b_.) + (a_))^(n_), x_Symbol] :> Int[ExpandI
ntegrand[(e*Cot[c + d*x])^m, (a + b*Csc[c + d*x])^n, x], x] /; FreeQ[{a, b, c, d, e, m}, x] && IGtQ[n, 0]

Rule 3473

Int[((b_.)*tan[(c_.) + (d_.)*(x_)])^(n_), x_Symbol] :> Simp[(b*(b*Tan[c + d*x])^(n - 1))/(d*(n - 1)), x] - Dis
t[b^2, Int[(b*Tan[c + d*x])^(n - 2), x], x] /; FreeQ[{b, c, d}, x] && GtQ[n, 1]

Rule 8

Int[a_, x_Symbol] :> Simp[a*x, x] /; FreeQ[a, x]

Rule 2606

Int[((a_.)*sec[(e_.) + (f_.)*(x_)])^(m_.)*((b_.)*tan[(e_.) + (f_.)*(x_)])^(n_.), x_Symbol] :> Dist[a/f, Subst[
Int[(a*x)^(m - 1)*(-1 + x^2)^((n - 1)/2), x], x, Sec[e + f*x]], x] /; FreeQ[{a, e, f, m}, x] && IntegerQ[(n -
1)/2] &&  !(IntegerQ[m/2] && LtQ[0, m, n + 1])

Rule 3767

Int[csc[(c_.) + (d_.)*(x_)]^(n_), x_Symbol] :> -Dist[d^(-1), Subst[Int[ExpandIntegrand[(1 + x^2)^(n/2 - 1), x]
, x], x, Cot[c + d*x]], x] /; FreeQ[{c, d}, x] && IGtQ[n/2, 0]

Rubi steps

\begin{align*} \int \cot ^2(c+d x) (a+a \sec (c+d x))^2 \, dx &=\int \left (a^2 \cot ^2(c+d x)+2 a^2 \cot (c+d x) \csc (c+d x)+a^2 \csc ^2(c+d x)\right ) \, dx\\ &=a^2 \int \cot ^2(c+d x) \, dx+a^2 \int \csc ^2(c+d x) \, dx+\left (2 a^2\right ) \int \cot (c+d x) \csc (c+d x) \, dx\\ &=-\frac{a^2 \cot (c+d x)}{d}-a^2 \int 1 \, dx-\frac{a^2 \operatorname{Subst}(\int 1 \, dx,x,\cot (c+d x))}{d}-\frac{\left (2 a^2\right ) \operatorname{Subst}(\int 1 \, dx,x,\csc (c+d x))}{d}\\ &=-a^2 x-\frac{2 a^2 \cot (c+d x)}{d}-\frac{2 a^2 \csc (c+d x)}{d}\\ \end{align*}

Mathematica [C]  time = 0.0382712, size = 46, normalized size = 1.31 \[ -\frac{2 a^2 \cot \left (\frac{c}{2}+\frac{d x}{2}\right ) \text{Hypergeometric2F1}\left (-\frac{1}{2},1,\frac{1}{2},-\tan ^2\left (\frac{c}{2}+\frac{d x}{2}\right )\right )}{d} \]

Antiderivative was successfully verified.

[In]

Integrate[Cot[c + d*x]^2*(a + a*Sec[c + d*x])^2,x]

[Out]

(-2*a^2*Cot[c/2 + (d*x)/2]*Hypergeometric2F1[-1/2, 1, 1/2, -Tan[c/2 + (d*x)/2]^2])/d

________________________________________________________________________________________

Maple [A]  time = 0.047, size = 50, normalized size = 1.4 \begin{align*}{\frac{1}{d} \left ({a}^{2} \left ( -\cot \left ( dx+c \right ) -dx-c \right ) -2\,{\frac{{a}^{2}}{\sin \left ( dx+c \right ) }}-{a}^{2}\cot \left ( dx+c \right ) \right ) } \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(cot(d*x+c)^2*(a+a*sec(d*x+c))^2,x)

[Out]

1/d*(a^2*(-cot(d*x+c)-d*x-c)-2*a^2/sin(d*x+c)-a^2*cot(d*x+c))

________________________________________________________________________________________

Maxima [A]  time = 1.66891, size = 65, normalized size = 1.86 \begin{align*} -\frac{{\left (d x + c + \frac{1}{\tan \left (d x + c\right )}\right )} a^{2} + \frac{2 \, a^{2}}{\sin \left (d x + c\right )} + \frac{a^{2}}{\tan \left (d x + c\right )}}{d} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cot(d*x+c)^2*(a+a*sec(d*x+c))^2,x, algorithm="maxima")

[Out]

-((d*x + c + 1/tan(d*x + c))*a^2 + 2*a^2/sin(d*x + c) + a^2/tan(d*x + c))/d

________________________________________________________________________________________

Fricas [A]  time = 0.898445, size = 96, normalized size = 2.74 \begin{align*} -\frac{a^{2} d x \sin \left (d x + c\right ) + 2 \, a^{2} \cos \left (d x + c\right ) + 2 \, a^{2}}{d \sin \left (d x + c\right )} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cot(d*x+c)^2*(a+a*sec(d*x+c))^2,x, algorithm="fricas")

[Out]

-(a^2*d*x*sin(d*x + c) + 2*a^2*cos(d*x + c) + 2*a^2)/(d*sin(d*x + c))

________________________________________________________________________________________

Sympy [F]  time = 0., size = 0, normalized size = 0. \begin{align*} a^{2} \left (\int 2 \cot ^{2}{\left (c + d x \right )} \sec{\left (c + d x \right )}\, dx + \int \cot ^{2}{\left (c + d x \right )} \sec ^{2}{\left (c + d x \right )}\, dx + \int \cot ^{2}{\left (c + d x \right )}\, dx\right ) \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cot(d*x+c)**2*(a+a*sec(d*x+c))**2,x)

[Out]

a**2*(Integral(2*cot(c + d*x)**2*sec(c + d*x), x) + Integral(cot(c + d*x)**2*sec(c + d*x)**2, x) + Integral(co
t(c + d*x)**2, x))

________________________________________________________________________________________

Giac [A]  time = 1.36719, size = 42, normalized size = 1.2 \begin{align*} -\frac{{\left (d x + c\right )} a^{2} + \frac{2 \, a^{2}}{\tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right )}}{d} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cot(d*x+c)^2*(a+a*sec(d*x+c))^2,x, algorithm="giac")

[Out]

-((d*x + c)*a^2 + 2*a^2/tan(1/2*d*x + 1/2*c))/d